/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exercises.day04.pt01.bean;

import exercises.day04.pt02.Exception.AHTIDIsNotNumericException;
import java.sql.Date;

/**
 *
 * @author Student
 */
public class Account_Holder_Transaction {

    private Integer ahtID = 0;
    private String accountID = "";
    private Date dateOfTransaction;
    private String particulars = "";
    private String checkNo = "";
    private Double amount = 0d;

    public Integer getAhtID() {
        return ahtID;
    }

    private void setAhtID(String ahtID) throws AHTIDIsNotNumericException {
        try {
            this.ahtID = Integer.valueOf(ahtID);
        } catch (NumberFormatException ex) {
            throw new AHTIDIsNotNumericException();
        }

    }

    public String getAccountID() {
        return accountID;
    }

    public void setAccountID(String accountID) {
        this.accountID = accountID;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public String getCheckNo() {
        return checkNo;
    }

    public void setCheckNo(String checkNo) {
        this.checkNo = checkNo;
    }

    public Date getDateOfTransaction() {
        return dateOfTransaction;
    }

    public void setDateOfTransaction(Date dateOfTransaction) {
        this.dateOfTransaction = dateOfTransaction;

    }

    public String getParticulars() {
        return particulars;
    }

    public void setParticulars(String particulars) {
        this.particulars = particulars;
    }

    public Account_Holder_Transaction(String ahtid, String accountID, String particulars, String checkNo, Double amount) throws AHTIDIsNotNumericException {
        this.accountID = accountID;


        this.particulars = particulars;
        this.checkNo = checkNo;
        this.amount = amount;
        this.setAhtID(ahtid);

        java.util.Date today = new java.util.Date();
        this.dateOfTransaction = new java.sql.Date(today.getTime());
    }
}
